module("Model: Bugstat.Models.ImportantDates")

test("findAll", function(){
	stop(2000);
	Bugstat.Models.ImportantDates.findAll({}, function(important_dates){
		start()
		ok(important_dates)
        ok(important_dates.length)
        ok(important_dates[0].name)
        ok(important_dates[0].description)
	});
	
})

test("create", function(){
	stop(2000);
	new Bugstat.Models.ImportantDates({name: "dry cleaning", description: "take to street corner"}).save(function(important_dates){
		start();
		ok(important_dates);
        ok(important_dates.id);
        equals(important_dates.name,"dry cleaning")
        important_dates.destroy()
	})
})
test("update" , function(){
	stop();
	new Bugstat.Models.ImportantDates({name: "cook dinner", description: "chicken"}).
            save(function(important_dates){
            	equals(important_dates.description,"chicken");
        		important_dates.update({description: "steak"},function(important_dates){
        			start()
        			equals(important_dates.description,"steak");
        			important_dates.destroy();
        		})
            })

});
test("destroy", function(){
	stop(2000);
	new Bugstat.Models.ImportantDates({name: "mow grass", description: "use riding mower"}).
            destroy(function(important_dates){
            	start();
            	ok( true ,"Destroy called" )
            })
})